import React from 'react';
import { connect } from 'react-redux'
import { TabBar } from 'antd-mobile'
import { withRouter } from 'react-router-dom';
class Mytaobao extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			selectedTab: 'blueTab',
		};
	}

	render() {
		const { pathname } = this.props.location;
		return (
			<div style={{
				position: 'fixed',
				width: '100%',
				bottom: 0
			}}>
				<TabBar
					unselectedTintColor="#949494"
					tintColor="red"
					barTintColor="white"
				>
					<TabBar.Item
						title="首页"
						key="home"
						icon={<i className='iconfont icon-shouye'></i>
						}
						selectedIcon={<i className='iconfont icon-icon_home'></i>
						}
						selected={pathname === '/'}
						onPress={() => {
							this.props.history.push('/');
						}}
						data-seed="logId"
					>

					</TabBar.Item>
					<TabBar.Item
						icon={
							<i className='iconfont icon-xinxiliebiao'></i>
						}
						selectedIcon={
							<i className='iconfont icon-xinxiliebiao'></i>
						}
						title="家教信息"
						key="information"
						selected={pathname === '/infor'}
						onPress={() => {
							this.props.history.push('/infor')
						}}
					>

					</TabBar.Item>
					<TabBar.Item
						icon={
							<i className='iconfont icon-danzi'></i>
						}
						selectedIcon={
							<i className='iconfont icon-danzi'></i>
						}
						title="发布家教单"
						key="publish"
						selected={pathname === '/publish'}
						onPress={() => {
							this.props.history.push('/publish')
						}}
					>

					</TabBar.Item>
					<TabBar.Item
						icon={
							<i className='iconfont icon-xinxi'></i>
						}
						selectedIcon={
							<i className='iconfont icon-xiaoxi-mianxing3-0'></i>
						}
						title="消息"
						key="message"
						selected={pathname === '/message'}
						onPress={() => {
							this.props.history.push('/message')
						}}
					>

					</TabBar.Item>

					<TabBar.Item
						icon={
							<i className='iconfont icon-wode'></i>
						}
						selectedIcon={
							<i className='iconfont icon-wodedangxuan'></i>
						}
						title="我的"
						key="my"
						selected={pathname === '/my'}
						onPress={() => {
							this.props.history.push('/my')
						}}
					>

					</TabBar.Item>
				</TabBar>
			</div>
		);
	}
}

const mapStateToProps = (state) => ({
	username: state.userinfo
})

export default connect(mapStateToProps)(withRouter(Mytaobao));